<template>
  <div>
    <div
      v-for="item in showDatas"
      :key="item.path"
      style="margin-bottom: -5px;"
      :class="direction?'direction1':''">
      <a
        :href="getAvatarView(item.path)"
        download="item.name"
        target="_blank">
        <a-icon type="paper-clip"/>
        <span style="margin-left: 7px">{{ item.name }}</span>
      </a>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'WFileShow',
    data () {
      return {
        showDatas: ''
      }
    },
    props: ['datas', 'direction'],
    created () {
    },
    mounted () {
    },
    methods: {
      getAvatarView: function (avatar) {
        return this.$getFileAccessHttpUrl(avatar)
      },
      close () {
      }
    },
    watch: {
      datas (val) {
        if (val) {
          this.showDatas = JSON.parse(val)
        }
      }
    }
  }
</script>

<style scoped>
.direction1{
  float:right;margin-left: 10px
}
</style>
